﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IntelliTouchMix
{
    public partial class PlayList : Form
    {
        public int picSize = 128;
        public Color c;
        public Font f;
        private AudioDjStudio.AudioDjStudio audioDjStudio1;

        public PlayList()
        {
            InitializeComponent();
            audioDjStudio1 = new AudioDjStudio.AudioDjStudio();
            this.Controls.Add(this.audioDjStudio1);

            audioDjStudio1.InitSoundSystem(1, 0, 0, 0, 0, -1);
            // audioDjStudio1.PlayListCreate(Player_1);
            playListTable.AutoScroll = true;

            c = System.Drawing.SystemColors.ActiveCaptionText;
            f = new System.Drawing.Font("Calisto MT", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            /*vScrollBarAdv1.LargeChange = 50;
            vScrollBarAdv1.SmallChange = 25;
            vScrollBarAdv1.Maximum = 100;*/
            loadSong("../carrusel/sample1.png","carrusel","Tania","40","40:32");
            //loadSong("../carrusel/sample2.png");
           //  loadSong("../carrusel/material.jpg");
           
        }
        public void loadSong(String nameImg,String author,String Title,String bpm,String time)
        {
            Image img = Image.FromFile(nameImg);
            PictureBox p = new PictureBox();
            playListTable.Controls.Add(p, 0, playListTable.RowCount-1);
            // Add image
            p.Image = img;
            p.Dock = DockStyle.Fill;
            p.SizeMode = PictureBoxSizeMode.StretchImage;
            // Add text box
            Label l = new Label();
            l.Text = 
                "Author:\t"+author+"\n"+
                "Title:\t"+Title+"\n"+
                "time:\t"+time+"\n"+
                "bpm:\t"+bpm+"\n"
                ;
            playListTable.Controls.Add(l, 1, playListTable.RowCount - 1);
            l.Dock = DockStyle.Fill;
            l.Font = f;
            l.ForeColor = c;
                                
            // Add new row
            playListTable.RowCount++;
            playListTable.RowStyles.Add(new RowStyle(SizeType.Absolute, picSize));

        }


        private void vScrollBarAdv1_Scroll(object sender, ScrollEventArgs e)
        {
            label1.Text = "Move to "+(e.NewValue-e.OldValue);
        }
    }
}
